# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=packit
pkgver=1.0
pkgrel=2
pkgdesc='A network auditing tool. Its value is derived from its ability to customize, inject, monitor, and manipulate IP traffic.'
arch=('x86_64' 'aarch64')
url='http://packit.sourceforge.net/'
depends=('libpcap' 'libnet')
makedepends=('gcc' 'make')
groups=('blackarch' 'blackarch-networking')
license=('GPL')
source=("http://packit.sourceforge.net/downloads/$pkgname-$pkgver.tgz")
sha512sums=('cc7e957d2149edbc92d4d914c9f29aecb7945bab43f2df7435bc4c21a4724f92e9d99990683e4d301384117f79819f87f423eaa28dbef11b37a96c4aa40a1398')

build() {
  cd "$pkgname-$pkgver"

  if [[ "$CARCH" == "i686" || "$CARCH" == "x86_64" ]];
  then
    ./configure --prefix=/usr --mandir=/usr/share/man
  else
    ./configure --build=arm --prefix=/usr --mandir=/usr/share/man
  fi

  make
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  mv "$pkgdir/usr/sbin" "$pkgdir/usr/bin"
}

